<template class="index_background">
  <div>
    <el-collapse>
      <div class="divcss5" style="border-bottom:3px solid #eee">
      <h5 align="left">企业信息管理>简历收藏</h5>
      </div>
        <!--<el-table :data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)"
        tooltip-effect="dark"
        @selection-change="handleSelectionChange">-->
        <el-table :data="tableData">
        <el-table-column prop="id" label="编号" width="100" align="center">
        </el-table-column>
        <el-table-column prop="name" label="姓名" width="100" align="center">
        </el-table-column>
        <el-table-column prop="school" label="学校" width="200" align="center">
        </el-table-column>
        <el-table-column prop="education" label="学历" width="100" align="center">
        </el-table-column>
        <el-table-column prop="major" label="专业" width="250" align="center">
        </el-table-column>
        <el-table-column prop="jobObjective" label="工作意向" width="200" align="center">
        </el-table-column>
       <el-table-column label="操作" width="300" align="center">
      <template slot-scope="scope" >
        <el-button
          size="mini"
          @click="handleLook(scope.$index, scope.row)">查看</el-button>
        <el-button
          size="mini"
          type="danger"
          @click="handleOpenDelete()">删除</el-button>
      </template>
    </el-table-column>
    </el-table>
    </el-collapse>
    <el-pagination v-if="total"
      background
      layout="prev, pager, next"
      :total="total">
    </el-pagination>
    </div>
</template>

<style>
.divcss5{
  margin:30px 0;
  color: rgb(144,144,144);
  height: 100px;
}
.index_background{
   background:white;
   }
  .lable{
    color: rgb(144,144,144);
    margin-top:30px;
    margin-bottom:30px;
  }
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
</style>

<script>
import fetch from "../api/fetch";

  export default {
    mounted() {
      this.getmyEntCollect({
        pageNum:1,
        pageSize:10,
        EntCollect:{
          eid:1001
        }
      });
    },
    data() {
      return {
        total: 0,
        tableData: [],
      }
    },
    async mounted() {
      const result = await fetch.getCVCollect({
    "EntCollect":{
        "eid":1001
    }})
      if (result.status === 200) {
        this.tableData = result.data.rows;
        this.total = result.data.total;     
      return {
      /*
       tableData: [
      {
        cvid:'',
        date: '2020-06-01',
        name: '张张涛',
        school:'中山大学',
        age:'25',
        education:'硕士',
        career:'图书情报与档案管理'
      },{
        cvid:'',
        date: '2020-06-01',
        name: '张张涛',
        school:'中山大学',
        age:'25',
        education:'硕士',
        career:'图书情报与档案管理'
      },{
        cvid:'',
        date: '2020-06-01',
        name: '张张涛',
        school:'中山大学',
        age:'25',
        education:'硕士',
        career:'图书情报与档案管理'
      },{
        cvid:'',
        date: '2020-06-01',
        name: '张张涛',
        school:'中山大学',
        age:'25',
        education:'硕士',
        career:'图书情报与档案管理'
      },{
        cvid:'',
        date: '2020-06-01',
        name: '张张涛',
        school:'中山大学',
        age:'25',
        education:'硕士',
        career:'图书情报与档案管理'
      },]*/
      tableData:[]
      }}
    },
     methods: {
       getmyEntCollect(EntCollect){
        fetch.getmyEntCollect(EntCollect).then(res => {
          console.log(res)
          this.tableData=res.data.data
        })
      },
      handleLook(index, row) {
        console.log(index, row);
      },
      handleOpenDelete() {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          /*
          var id = this.list[index].id;
          console.log(id);
          this.axios
            .post(`/../../delete`,this.$qs.stringify({id:id}))
            .then(res => res.data)
            .then(data => {
              console.log(data);
              if(data.code === 200){
                this.list.splice(index,1);
                this.$message({
                  type: 'success',
                  message: '删除成功!'
                });
              }
            })
          */
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });          
        });
      }
    }
  };

/*
export default {
    name: "dataList",
    data() {
      return {
        tableData: [],
        multipleSelection: [],
        total: 0,
        pagesize:10,
        currentPage:1
>>>>>>> 2859b305a2f97f470f7cbd805c601446b5fea6ab
      }
    },
    methods: {
      handleLook(index, row) {
        console.log(index, row);
      },
      handleDelete(index, row) {
        console.log(index, row);
      },
     
    }
  };*/
 </script>